#ifndef OCAPP_H
#define OCAPP_H

#include <QMainWindow>
#include <QSplashScreen>
#include <QtWebEngineWidgets/QWebEngineView>
#include <QTextEdit>

#define ApplicationName "Weathertoy"

class LabViewer : public QMainWindow
{
	Q_OBJECT
public:
	LabViewer(bool simple = false,QWidget *parent = 0);
	~LabViewer();
	QSplashScreen* mSplash;
public slots:
	QWebEngineView* getWebView();
	static LabViewer* instance();
	bool isSimpleMode(){return mSimpleMode;}
	virtual bool eventFilter(QObject* obj, QEvent* e);
	void loadProgress(int progress);
	void loadFinished(bool ok);
protected:
	void setSize();
	virtual bool nativeEvent(const QByteArray& eventType, void* message, long* result);
private:
	int									mPort;
	bool								mSimpleMode;
	QString								mAppendJS;
	QTextEdit*							mEdit;
	QWidget*							mRibbonMenuWidget;
	QWebEngineView*						mWebView;
	static LabViewer*					mInstrance;
};

#endif // OCAPP_H
